enum SoccerEvent{
  goal(id: 1, name: "进球", asset: "event_goal.png"),
  redCard(id: 2, name: "红牌", asset: "event_red_card.png"),
  yellowCard(id: 3, name: "黄牌", asset: "event_yellow_card.png"),
  offside(id: 4, name: "越位"),
  matchEnd(id: 5, name: "比赛结束", asset: "event_match_end.png"),
  possession(id: 6, name: "控球率"),
  penalty(id: 7, name: "点球", asset: "event_penalty.png"),
  ownGoal(id: 8, name: "乌龙", asset: "event_own_goal.png"),
  secondYellowCard(id: 9, name: "两黄变红", asset: "event_second_yellow_card.png"),
  kickOff(id: 10, name: "开球"),
  substitution(id: 11, name: "换人", asset: "event_substitution.png"),
  freeKick(id: 12, name: "任意球"),
  missedPenalty(id: 13, name: "射失点球", asset: "event_missed_penalty.png"),
  varEvent(id: 14, name: "VAR", asset: "event_var.png"),
  header(id: 15, name: "头球"),
  goalkeeperAdvance(id: 16, name: "守门员出击"),
  turnover(id: 17, name: "丢球"),
  tackle(id: 18, name: "抢断"),
  interception(id: 19, name: "阻截"),
  pass(id: 20, name: "传球"),
  assist(id: 21, name: "助攻"),
  slideTackle(id: 22, name: "铲球"),
  dribble(id: 23, name: "过人"),
  attack(id: 24, name: "进攻"),
  clearance(id: 25, name: "解围"),
  intercept(id: 26, name: "拦截"),
  defend(id: 27, name: "防守"),
  counterAttack(id: 28, name: "反击"),
  throwIn(id: 29, name: "界外球"),
  goalKick(id: 30, name: "球门球"),
  outOfBounds(id: 31, name: "出界"),
  pass32(id: 32, name: "传球"),
  passSuccessRate(id: 33, name: "成功率"),
  successfulTackle(id: 34, name: "成功抢断"),
  goalDisallowed(id: 35, name: "进球取消"),
  penaltyOverturned(id: 36, name: "取消点球"),
  foulCausingPenalty(id: 37, name: "犯规造成点球"),
  penaltySaved(id: 38, name: "扑出点球"),
  goalkeeperInjurySave(id: 39, name: "救球受伤"),
  playerReturnsFromInjury(id: 40, name: "受伤回归"),
  shoot(id: 41, name: "射门"),
  missedShot(id: 42, name: "射门不中"),
  hitWoodwork(id: 43, name: "中柱"),
  shotBlocked(id: 44, name: "射门被挡"),
  onTargetShot(id: 45, name: "射正"),
  foul(id: 46, name: "犯规"),
  possessionChange(id: 47, name: "球权"),
  matchStart(id: 48, name: "比赛开始", asset: "event_match_start.png"),
  cornerKick(id: 49, name: "角球", asset: "event_corner_kick.png"),
  other(id: 50, name: "其他"),
  matchAborted(id: 51, name: "腰斩"),
  pause(id: 52, name: "中断"),
  halfTime(id: 53, name: "半场结束"),
  halfTimeScore(id: 54, name: "半场比分"),
  addedTime(id: 55, name: "伤停补时"),
  dangerousAttack(id: 56, name: "危险进攻"),
  extraTimeEnd(id: 57, name: "加时赛结束"),
  penaltyShootoutEnd(id: 58, name: "点球大战结束"),
  penaltyDuringShootout(id: 59, name: "点球（点球大战）", asset: "event_penalty.png"),
  missedPenaltyShootout(id: 60, name: "点球未进（点球大战）", asset: "event_missed.png");

  final int id;
  final String name;
  final String? asset;

  const SoccerEvent({required this.id,required this.name,this.asset});

  static SoccerEvent? fromId(int? id) {
    for (var element in SoccerEvent.values) {
      if (element.id == id) {
        return element;
      }
    }
    return null;
  }
}